﻿using System;
using System.ComponentModel.Design;

namespace YArchitech.Controls.ImgListView
{
	internal class ColumnHeaderCollectionEditor : CollectionEditor
	{
		public ColumnHeaderCollectionEditor() : base(typeof(ImageListView.ImageListViewColumnHeaderCollection))
		{
		}

		protected override bool CanRemoveInstance(object value)
		{
			return false;
		}

		protected override Type[] CreateNewItemTypes()
		{
			return new Type[0];
		}

		protected override string GetDisplayText(object value)
		{
			return ((ImageListView.ImageListViewColumnHeader)value).Type.ToString();
		}

		protected override bool CanSelectMultipleInstances()
		{
			return false;
		}

		protected override object[] GetItems(object editValue)
		{
			ImageListView.ImageListViewColumnHeaderCollection imageListViewColumnHeaderCollection = (ImageListView.ImageListViewColumnHeaderCollection)editValue;
			object[] array = new object[imageListViewColumnHeaderCollection.Count];
			for (int i = 0; i < imageListViewColumnHeaderCollection.Count; i++)
			{
				array[i] = imageListViewColumnHeaderCollection[i];
			}
			return array;
		}

		protected override CollectionEditor.CollectionForm CreateCollectionForm()
		{
			return base.CreateCollectionForm();
		}
	}
}
